package com.network.utils.demo.model;

import android.app.Application;

import com.network.utils.demo.api.AppUpDataApi;
import com.network.utils.demo.http.ParamsUtil;
import com.network.retrofit.net.RetrofitClient;
import com.network.retrofit.utils.NetWorkLogUtil;
import com.trello.rxlifecycle3.LifecycleTransformer;

import java.util.Map;

/**
 * 项目: com.network.utils.demo
 * 创建人: LuoFG
 * 创建时间: 2021/6/30  15:04
 * 描述:
 */
public class TestModel extends BaseModel<TestBean> {

    public void load(Application application,LifecycleTransformer lifecycleTransformer){
        Map<String, String> params= ParamsUtil.getParams();
        ParamsUtil.setPublicParam(params,application);
        ParamsUtil.showParam(params);
        RetrofitClient.getService().instanceRetrofitGson(AppUpDataApi.class)
                .getAppInfo(params)
                .compose(rxConfig(null))
                .subscribe(this);

    }


    @Override
    public void success(TestBean data, String msg) {
        NetWorkLogUtil.logE("success");
    }

    @Override
    public void failure(int code, String msg) {
        NetWorkLogUtil.logE("failure");
    }
}
